home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SVM Mac CD-ROM 17
/
SVM Mac CD-ROM - No 17.iso
/
Accès direct
/
Trésors du domaine public
/
Programmation
/
launch-creator
/
Readme
< prev
next >
Wrap
Text File
|
1996-06-09
|
2KB
|
51 lines
What: get any file/folder "double-clicked" from within a running program
Keywords: launch, Finder, scripting, AppleEvent
Contents:
Readme - this file
launcher.cc - commented source code
vlauncher.cc - verification routine
vlauncher.pi - CW9 project to run the test
alias_to_fname.cc - get the full file name from an FSSpec/AliasHandle
mymenv.cc \
mymenv.h - my standard Mac env (included for completeness)
notify.cc /
Language: C++, CodeWarrior9
System: System 7.x (7.5.3) but probably 6.x is OK, too.
Comments to: oleg@ponder.csci.unt.edu, oleg@unt.edu
Version 1.1, June 1996
New in version 1.1
- file/folder name to open can be specified either as an ASCII C string, or
as a FSSpec
- included (and shown off) code to convert FSSpec to the full path name
(and how it can be used to figure out the full path name to the system folder)
- now works under CW9 (the previous version was compiled with Symantec C++ 6.0)
Explanation:
This is a simple program that, given a file name or FSSpec, launches an
application-creator and has it handle the file. If the file
is an application, it is launched itself. The net result is
exactly the same as if the user had double-clicked on the file.
Synopsis
void open_selection(const FSSpec& file_spec)
void open_selection(const char * full_path_name)
Where the 'full_path_name' tells the full path name of the file/folder that
should be "double-clicked". Though, a relative path name would do,
too. The 'file_spec' tells the file specification (volume refno,
directory ID and the file name) of the file/folder to "double-click" on.
Please check out vlauncher.cc to see various ways of vicarious clicking on
files/folders from a running code.
The present program achieves the magic by sending an 'Open Selection'
event to the Finder. It is significantly based on the FinderEvents
stack by Jon Pugh and Apple Computer, Inc. (C) 1991-92 Apple Computer, Inc.)
(which is written in Pascal and _very_ big and messy)
If you need further information or details, please mail me. If you want to see more
functionality added, mail me too.